﻿#if INTERACTIVE
#I @"..\FsMongo"
#load "FsBson.fs"
#load "FsMgProtocol.fs"
#load "FsMgDriver.fs"
#else
module ExtTests
#endif

open FsBson
open FsMgDriver
open FsMgProtocol
open System
open System.IO

let jsPath = @"c:\ws\fsharp\WebSharper\js"
let js1 = Path.Combine(jsPath,"js1.js") |> File.ReadAllText
let js2 = Path.Combine(jsPath,"js2.js") |> File.ReadAllText

let bJs1 = bson ["_id", bval "Intellifactory"; "value", Bson.BJS js1]
let bJs2 = bson ["_id", bval "Intellifactory2"; "value", Bson.BJS js2]

insertC "bom.system.js" [bJs1; bJs2]

findOneC "admin.$cmd" (bson ["getLastError",1])
findOneC "admin.$cmd" (bson ["getLog","*"])

findOneC "bom.system.js" (bson[])

queryC {defQ with Collection="bom.system.js"; Take=100}
